<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-image: url(images/background.jpg);
	background-repeat: repeat-x;
	background-position: center top;
	background-attachment: fixed;
	margin: 0px;
	padding: 0px;
}
#content {
	font-family: "Century Gothic";
	font-size: 16px;
	color: #FFF;
	text-align: center;
	height: 250px;
	background-image: url(images/black.png);
	background-repeat: repeat;
	width: 980px;
	margin-right: auto;
	margin-left: auto;
	padding-top: 50px;
}
#content b {
	font-weight: normal;
	color: #FFFFFF;
	background-image: url(images/blue.png);
	background-repeat: repeat;
	padding: 5px;
}
#content a {
	font-weight: normal;
	color: #FFFFFF;
	background-image: url(images/blue.png);
	background-repeat: repeat;
	padding: 5px;
	font-family: "Century Gothic";
	font-size: 18px;
}
#content a:hover {
	font-weight: normal;
	color: #000000;
	background-image: url(images/white.png);
	background-repeat: repeat;
	padding: 5px;
	font-family: "Century Gothic";
	font-size: 18px;
	cursor: pointer;
}
</style>
</head>

<body onload="MM_preloadImages('images/facebookHover.png')">



<?php 
include "header.php"; 
include "connect.php";
?>

<div id="content">

<?php  
  
//Check if something was posted
if( isset($_POST['productID'])) {} else { header('Location: index.php');}

//Get variables
$productID = $_POST['productID'];
$productName = $_POST['productName'];
$productCost = $_POST['productCost'];

$title=$_POST['title'];
$name=$_POST['name'];
$postcode=$_POST['postcode'];
$addressLine1=$_POST['addressLine1'];
$addressLine2=$_POST['addressLine2'];
$email=$_POST['email'];
$contactNumber=$_POST['contactNumber'];
$town=$_POST['town'];

//Send Message
$to = "sales@24-7saddles.com";
$subject = "Trial Saddle - Back Order";
$emailMessage = 
$title . " " . $name . "\n\n".
"Postcode: ".$postcode." Address: ".$addressLine1 . " " . $addressLine2 . "\n\n".
"Town:" . $town . "\n\n".
"Contact Number: " . $contactNumber . "\n\n".
"Email Address: ".$email."\n\n\n\n".
"Product Details...\n\n\n\n".
"Product ID: ".$productID." " . $productName."\n\n".  
"Product Cost: £" . $productCost . "\n\n".
$from = $email;
$headers = "From: " . $email;

if (mail($to,$subject,$emailMessage,$headers))
if (mail("hannahroberts247@yahoo.com",$subject,$emailMessage,$headers))

{
   echo("<p>Thankyou for your interest in <b>" . $productName . "</b></p>\n\n
   <p>We will contact you shortly on <b>" . $contactNumber . "</b> in regards to your purchase.</b></p>\n\n
   <p>If you wish to contact us sooner regarding your order please call us on <b>07908471905</b></p>
   <br \><br \>
   <a href='index.php'>Complete Order</a>
   ");
  } else {
   echo("Sorry there was a error during your purchase, please try again");
  }

?>

</div>

</div>
<!--Content #End-->

<?php include"footer.php" ?>


</body>
</html>